/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * CadastroProduto.java
 *
 * Created on 27/05/2010, 20:18:51
 */

package br.com.pi.SmartFast.view;

import br.com.pi.SmartFast.controler.ControleTelaCadastroProduto;

/**
 *
 * @author Alessandro
 */
public class TelaCadastroProduto extends javax.swing.JFrame {

    ControleTelaCadastroProduto control ;//inicializa a variável control

    /** Creates new form CadastroProduto */
    public TelaCadastroProduto() {
        initComponents();
        control = new ControleTelaCadastroProduto(bt_editar, bt_imagem, 
                bt_localizar_item, bt_sair, bt_salvar, chbox_ativo, combo_tipo_produto, tab_produtos,
                txt_codigo, txt_custo, txt_estoque, txt_nome_produto, txt_venda,jd_imagem,jfc_imagem,
                this,jd_itens_produto,lbl_fotoItens,lbl_nome_produto,jList_itens_produto,jList_itens,
                bt_sair_itens,jrb_sobremesa,jrb_salgados,jrb_todos,jr_bebidas);

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jd_imagem = new javax.swing.JDialog();
        jfc_imagem = new javax.swing.JFileChooser();
        jd_itens_produto = new javax.swing.JDialog();
        jScrollPane3 = new javax.swing.JScrollPane();
        jList_itens_produto = new javax.swing.JList();
        jScrollPane2 = new javax.swing.JScrollPane();
        jList_itens = new javax.swing.JList();
        jPanel1 = new javax.swing.JPanel();
        jrb_sobremesa = new javax.swing.JRadioButton();
        jrb_salgados = new javax.swing.JRadioButton();
        jrb_todos = new javax.swing.JRadioButton();
        jr_bebidas = new javax.swing.JRadioButton();
        bt_sair_itens = new javax.swing.JButton();
        lbl_fotoItens = new javax.swing.JLabel();
        lbl_nome_produto = new javax.swing.JLabel();
        botoes_itens = new javax.swing.ButtonGroup();
        bt_imagem = new javax.swing.JButton();
        txt_nome_produto = new javax.swing.JTextField();
        combo_tipo_produto = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        txt_codigo = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        txt_custo = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        txt_venda = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        txt_estoque = new javax.swing.JTextField();
        chbox_ativo = new javax.swing.JCheckBox();
        jScrollPane1 = new javax.swing.JScrollPane();
        tab_produtos = new javax.swing.JTable();
        bt_salvar = new javax.swing.JButton();
        bt_editar = new javax.swing.JButton();
        bt_localizar_item = new javax.swing.JButton();
        bt_sair = new javax.swing.JButton();

        jd_imagem.setBounds(new java.awt.Rectangle(0, 0, 600, 400));
        jd_imagem.addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                jd_imagemWindowOpened(evt);
            }
        });

        jfc_imagem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jfc_imagemActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jd_imagemLayout = new javax.swing.GroupLayout(jd_imagem.getContentPane());
        jd_imagem.getContentPane().setLayout(jd_imagemLayout);
        jd_imagemLayout.setHorizontalGroup(
            jd_imagemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jd_imagemLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jfc_imagem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jd_imagemLayout.setVerticalGroup(
            jd_imagemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jd_imagemLayout.createSequentialGroup()
                .addComponent(jfc_imagem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jd_itens_produto.setTitle("Cadastro de Itens produto");
        jd_itens_produto.setBounds(new java.awt.Rectangle(0, 0, 800, 600));
        jd_itens_produto.addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                jd_itens_produtoWindowOpened(evt);
            }
        });

        jList_itens_produto.setBackground(new java.awt.Color(204, 255, 204));
        jList_itens_produto.setVisibleRowCount(10);
        jList_itens_produto.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jList_itens_produtoMouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(jList_itens_produto);

        jList_itens.setBackground(new java.awt.Color(204, 255, 204));
        jList_itens.setVisibleRowCount(10);
        jList_itens.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jList_itensMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(jList_itens);

        jPanel1.setBackground(new java.awt.Color(204, 255, 204));
        jPanel1.setForeground(new java.awt.Color(204, 255, 204));

        jrb_sobremesa.setBackground(new java.awt.Color(204, 255, 204));
        botoes_itens.add(jrb_sobremesa);
        jrb_sobremesa.setText("Itens sobremesa");
        jrb_sobremesa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_sobremesaActionPerformed(evt);
            }
        });

        jrb_salgados.setBackground(new java.awt.Color(204, 255, 204));
        botoes_itens.add(jrb_salgados);
        jrb_salgados.setText("Itens Salgados");
        jrb_salgados.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_salgadosActionPerformed(evt);
            }
        });

        jrb_todos.setBackground(new java.awt.Color(204, 255, 204));
        botoes_itens.add(jrb_todos);
        jrb_todos.setText("Todos itens");
        jrb_todos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_todosActionPerformed(evt);
            }
        });

        jr_bebidas.setBackground(new java.awt.Color(204, 255, 204));
        botoes_itens.add(jr_bebidas);
        jr_bebidas.setText("Bebidas");
        jr_bebidas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jr_bebidasActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jrb_sobremesa)
                    .addComponent(jrb_salgados)
                    .addComponent(jrb_todos)
                    .addComponent(jr_bebidas))
                .addContainerGap(42, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addComponent(jrb_sobremesa)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jrb_salgados)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jr_bebidas)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jrb_todos)
                .addContainerGap(28, Short.MAX_VALUE))
        );

        bt_sair_itens.setText("Sair");
        bt_sair_itens.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_sair_itensActionPerformed(evt);
            }
        });

        lbl_fotoItens.setText("foto");

        lbl_nome_produto.setFont(new java.awt.Font("Tempus Sans ITC", 1, 24));
        lbl_nome_produto.setText("Nome Produto");

        javax.swing.GroupLayout jd_itens_produtoLayout = new javax.swing.GroupLayout(jd_itens_produto.getContentPane());
        jd_itens_produto.getContentPane().setLayout(jd_itens_produtoLayout);
        jd_itens_produtoLayout.setHorizontalGroup(
            jd_itens_produtoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jd_itens_produtoLayout.createSequentialGroup()
                .addGroup(jd_itens_produtoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jd_itens_produtoLayout.createSequentialGroup()
                        .addGap(37, 37, 37)
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jd_itens_produtoLayout.createSequentialGroup()
                        .addGap(99, 99, 99)
                        .addComponent(lbl_fotoItens)))
                .addGap(88, 88, 88)
                .addGroup(jd_itens_produtoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jd_itens_produtoLayout.createSequentialGroup()
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(41, 41, 41)
                        .addGroup(jd_itens_produtoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(bt_sair_itens, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(lbl_nome_produto))
                .addContainerGap(71, Short.MAX_VALUE))
        );
        jd_itens_produtoLayout.setVerticalGroup(
            jd_itens_produtoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jd_itens_produtoLayout.createSequentialGroup()
                .addGap(74, 74, 74)
                .addGroup(jd_itens_produtoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbl_fotoItens)
                    .addComponent(lbl_nome_produto))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 77, Short.MAX_VALUE)
                .addGroup(jd_itens_produtoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jd_itens_produtoLayout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 127, Short.MAX_VALUE)
                        .addComponent(bt_sair_itens, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 315, Short.MAX_VALUE)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 310, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(32, 32, 32))
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Cadastro de Produtos");
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
        });

        bt_imagem.setText("IMAGEM PRODUTO");
        bt_imagem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_imagemActionPerformed(evt);
            }
        });

        jLabel1.setText("Tipo de Produto");

        jLabel2.setText("Nome Produto");

        jLabel3.setText("Código");

        jLabel4.setText("R$ Custo");

        jLabel5.setText("R$ Venda");

        jLabel6.setText("Estoque");

        chbox_ativo.setText("Produto a Venda");

        tab_produtos.setFont(new java.awt.Font("Accord Heavy SF", 1, 12)); // NOI18N
        tab_produtos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "TIPO PRODUTO", "CÓDIGO", "NOME", "VENDA", "DISPONÍVEL"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tab_produtos.setShowHorizontalLines(false);
        tab_produtos.setShowVerticalLines(false);
        tab_produtos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tab_produtosMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tab_produtos);
        tab_produtos.getColumnModel().getColumn(0).setMinWidth(80);
        tab_produtos.getColumnModel().getColumn(0).setMaxWidth(80);
        tab_produtos.getColumnModel().getColumn(1).setMinWidth(80);
        tab_produtos.getColumnModel().getColumn(1).setMaxWidth(80);
        tab_produtos.getColumnModel().getColumn(2).setMinWidth(300);
        tab_produtos.getColumnModel().getColumn(2).setMaxWidth(300);
        tab_produtos.getColumnModel().getColumn(3).setMinWidth(100);
        tab_produtos.getColumnModel().getColumn(3).setMaxWidth(100);
        tab_produtos.getColumnModel().getColumn(4).setMinWidth(100);
        tab_produtos.getColumnModel().getColumn(4).setMaxWidth(100);

        bt_salvar.setBackground(new java.awt.Color(204, 255, 204));
        bt_salvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/view/salvar.png"))); // NOI18N
        bt_salvar.setText("Salvar");
        bt_salvar.setBorder(null);
        bt_salvar.setBorderPainted(false);
        bt_salvar.setOpaque(false);
        bt_salvar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_salvarActionPerformed(evt);
            }
        });

        bt_editar.setBackground(new java.awt.Color(204, 204, 255));
        bt_editar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/editar.png"))); // NOI18N
        bt_editar.setText("editar");
        bt_editar.setBorder(null);
        bt_editar.setBorderPainted(false);
        bt_editar.setOpaque(false);
        bt_editar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_editarActionPerformed(evt);
            }
        });

        bt_localizar_item.setBackground(new java.awt.Color(204, 204, 255));
        bt_localizar_item.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/view/itens.png"))); // NOI18N
        bt_localizar_item.setText("Itens");
        bt_localizar_item.setBorder(null);
        bt_localizar_item.setBorderPainted(false);
        bt_localizar_item.setOpaque(false);
        bt_localizar_item.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_localizar_itemActionPerformed(evt);
            }
        });

        bt_sair.setBackground(new java.awt.Color(204, 204, 255));
        bt_sair.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/imgSair.png"))); // NOI18N
        bt_sair.setText("Sair");
        bt_sair.setBorder(null);
        bt_sair.setBorderPainted(false);
        bt_sair.setOpaque(false);
        bt_sair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_sairActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(28, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 671, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(bt_imagem, javax.swing.GroupLayout.DEFAULT_SIZE, 201, Short.MAX_VALUE)
                        .addGap(51, 51, 51)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)
                                .addGap(307, 307, 307))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(txt_nome_produto, javax.swing.GroupLayout.PREFERRED_SIZE, 312, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(64, 64, 64))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(combo_tipo_produto, javax.swing.GroupLayout.PREFERRED_SIZE, 223, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 77, Short.MAX_VALUE)
                                        .addGap(147, 147, 147)))
                                .addGap(3, 3, 3)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 36, Short.MAX_VALUE)
                                        .addGap(38, 38, 38))
                                    .addComponent(txt_codigo, javax.swing.GroupLayout.DEFAULT_SIZE, 74, Short.MAX_VALUE))
                                .addGap(75, 75, 75))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txt_custo, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addGap(36, 36, 36)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, 47, Short.MAX_VALUE)
                                        .addGap(34, 34, 34))
                                    .addComponent(txt_venda, javax.swing.GroupLayout.DEFAULT_SIZE, 81, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(txt_estoque, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)
                                        .addGap(18, 18, 18)
                                        .addComponent(chbox_ativo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addGap(164, 164, 164)))))
                        .addGap(43, 43, 43))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(bt_salvar, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(bt_editar, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(24, 24, 24)
                        .addComponent(bt_localizar_item, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(bt_sair, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(11, 11, 11)))
                .addContainerGap(235, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addComponent(bt_imagem, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(35, 35, 35)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(jLabel3))
                        .addGap(3, 3, 3)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(combo_tipo_produto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txt_codigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txt_nome_produto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(jLabel6)
                            .addComponent(jLabel5))
                        .addGap(3, 3, 3)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(txt_estoque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(chbox_ativo))
                            .addComponent(txt_custo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txt_venda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(43, 43, 43)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(bt_salvar, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE)
                    .addComponent(bt_sair, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE)
                    .addComponent(bt_editar, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE)
                    .addComponent(bt_localizar_item, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 33, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 253, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jfc_imagemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jfc_imagemActionPerformed

        control.botaoAbrirImagem();

    }//GEN-LAST:event_jfc_imagemActionPerformed

    private void jd_imagemWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_jd_imagemWindowOpened

        this.setLocationRelativeTo(null);
    }//GEN-LAST:event_jd_imagemWindowOpened

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened

        control.setAoAbrirTela();

    }//GEN-LAST:event_formWindowOpened

    private void bt_salvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_salvarActionPerformed

        control.botaoSalvar();
    }//GEN-LAST:event_bt_salvarActionPerformed

    private void bt_localizar_itemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_localizar_itemActionPerformed

    control.botaoItens();
        
    }//GEN-LAST:event_bt_localizar_itemActionPerformed

    private void bt_sairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_sairActionPerformed

        control.botaoSair();

    }//GEN-LAST:event_bt_sairActionPerformed

    private void jrb_sobremesaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_sobremesaActionPerformed

        control.getItensProduto();
        
    }//GEN-LAST:event_jrb_sobremesaActionPerformed

    private void jrb_salgadosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_salgadosActionPerformed

        control.getItensProduto();

    }//GEN-LAST:event_jrb_salgadosActionPerformed

    private void jrb_todosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_todosActionPerformed

        control.getItensProduto();

    }//GEN-LAST:event_jrb_todosActionPerformed

    private void jList_itensMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jList_itensMouseClicked

        control.setAoClicarJListItem(evt.getClickCount());

    }//GEN-LAST:event_jList_itensMouseClicked

    private void jd_itens_produtoWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_jd_itens_produtoWindowOpened

        
    }//GEN-LAST:event_jd_itens_produtoWindowOpened

    private void jr_bebidasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jr_bebidasActionPerformed

        control.getItensProduto();
        
    }//GEN-LAST:event_jr_bebidasActionPerformed

    private void bt_sair_itensActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_sair_itensActionPerformed

        control.botaoSairItens();

    }//GEN-LAST:event_bt_sair_itensActionPerformed

    private void jList_itens_produtoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jList_itens_produtoMouseClicked

        control.setAoClicarJListItensProduto(evt.getClickCount());
        
    }//GEN-LAST:event_jList_itens_produtoMouseClicked

    private void tab_produtosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tab_produtosMouseClicked

        control.duploCliqueTabelaProdutos(evt.getClickCount());
    }//GEN-LAST:event_tab_produtosMouseClicked

    private void bt_editarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_editarActionPerformed

        control.botaoEditar();
        
    }//GEN-LAST:event_bt_editarActionPerformed

    private void bt_imagemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_imagemActionPerformed

        control.botaoLocalizarImagem();
    }//GEN-LAST:event_bt_imagemActionPerformed

    /**
    * @param args the command line arguments
    */
//    public static void main(String args[]) {
//        java.awt.EventQueue.invokeLater(new Runnable() {
//            public void run() {
//                new TelaCadastroProduto().setVisible(true);
//            }
//        });
//    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup botoes_itens;
    private javax.swing.JButton bt_editar;
    private javax.swing.JButton bt_imagem;
    private javax.swing.JButton bt_localizar_item;
    private javax.swing.JButton bt_sair;
    private javax.swing.JButton bt_sair_itens;
    private javax.swing.JButton bt_salvar;
    private javax.swing.JCheckBox chbox_ativo;
    private javax.swing.JComboBox combo_tipo_produto;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JList jList_itens;
    private javax.swing.JList jList_itens_produto;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JDialog jd_imagem;
    private javax.swing.JDialog jd_itens_produto;
    private javax.swing.JFileChooser jfc_imagem;
    private javax.swing.JRadioButton jr_bebidas;
    private javax.swing.JRadioButton jrb_salgados;
    private javax.swing.JRadioButton jrb_sobremesa;
    private javax.swing.JRadioButton jrb_todos;
    private javax.swing.JLabel lbl_fotoItens;
    private javax.swing.JLabel lbl_nome_produto;
    private javax.swing.JTable tab_produtos;
    private javax.swing.JTextField txt_codigo;
    private javax.swing.JTextField txt_custo;
    private javax.swing.JTextField txt_estoque;
    private javax.swing.JTextField txt_nome_produto;
    private javax.swing.JTextField txt_venda;
    // End of variables declaration//GEN-END:variables

}
